

using System;
using System.Collections.Generic;
using System.Text;
using EntityLayer;
using System.Data;
using DataAccessLayer;
using InfraStructureLayer;

namespace DataLayer
{
	public class datArticleArticleCategories
	{
		public datArticleArticleCategories()
		{
		}
		
        #region  Code Factory Generated Methods

        public void InsertArticleArticleCategories(entArticleArticleCategories parEntArticleArticleCategories, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pArticleId", parEntArticleArticleCategories.ArticleId);
            insDbParamCollection.Add("@pArticleCategoryId", parEntArticleArticleCategories.ArticleCategoryId);
            insDbParamCollection.AddOutput("@pArticleArticleCategoryId", DbType.Int32);
            parDbConnector.ExecuteNonQuery("InsertArticleArticleCategories", insDbParamCollection);
            parEntArticleArticleCategories.ArticleArticleCategoryId = Convert.ToInt32(insDbParamCollection.GetOutPutParameter().Value);
        }

        #endregion
        public DataTable SelectArticleArticleCategoriesByArticleId(entArticleArticleCategories parEntArticleArticleCategories, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pArticleId", parEntArticleArticleCategories.ArticleId);
            return parDbConnector.ExecuteDataTable("SelectArticleArticleCategoriesByArticleId", insDbParamCollection);
        }
        public void DeleteArticleArticleCategoriesByArticleId(entArticleArticleCategories parEntArticleArticleCategories, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pArticleId", parEntArticleArticleCategories.ArticleId);
            parDbConnector.ExecuteNonQuery("DeleteArticleArticleCategoriesByArticleId", insDbParamCollection);
        }
        public DataTable SelectArticleArticleCategoriesByArticleCategoryId(entArticleArticleCategories parEntArticleArticleCategories, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pArticleCategoryId", parEntArticleArticleCategories.ArticleCategoryId);
            return parDbConnector.ExecuteDataTable("SelectArticleArticleCategoriesByArticleCategoryId", insDbParamCollection);
        }
        public DataTable SelectArticleArticleCategoriesByArticleIdAndLanguageId(entArticleArticleCategories parEntArticleArticleCategories, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pArticleId", parEntArticleArticleCategories.ArticleId);
            insDbParamCollection.Add("@pLanguageId", CurrentContext.LanguageId);
            return parDbConnector.ExecuteDataTable("SelectArticleArticleCategoriesByArticleIdAndLanguageId", insDbParamCollection);
        }
	}
}